home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / filesyst / ifs-5.1a- / ifs-5.1a-module-for-1.1.88
Text File  |  1995-02-06  |  13KB  |  439 lines

  1. Only in ifs.5.1a: .desc.txt
  2. diff --unified --recursive --new-file ifs.5.1a/fs/ifs/Makefile ifs-module/fs/ifs/Makefile
  3. --- ifs.5.1a/fs/ifs/Makefile    Tue Apr 26 04:04:48 1994
  4. +++ ifs-module/fs/ifs/Makefile    Mon Jan  9 01:28:40 1995
  5. @@ -7,6 +7,10 @@
  6.  #
  7.  # Note 2! The CFLAGS definitions are now in the main makefile...
  8.  
  9. +ifndef CONFIG_IFS_FS
  10. +CFLAGS := -I. $(CFLAGS) -DMODULE
  11. +endif
  12. +
  13.  .c.s:
  14.      $(CC) $(CFLAGS) -S $<
  15.  .c.o:
  16. @@ -18,6 +22,8 @@
  17.  
  18.  ifs.o:    $(OBJS)
  19.      $(LD) -r -o ifs.o $(OBJS)
  20. +
  21. +modules: ifs.o
  22.  
  23.  clean:
  24.      rm -f core *.o *.a tmp_make
  25. diff --unified --recursive --new-file ifs.5.1a/fs/ifs/clone.c ifs-module/fs/ifs/clone.c
  26. --- ifs.5.1a/fs/ifs/clone.c    Tue Apr 26 04:04:48 1994
  27. +++ ifs-module/fs/ifs/clone.c    Mon Feb  6 21:34:39 1995
  28. @@ -4,6 +4,10 @@
  29.   *  Written 1992,1993 by Werner Almesberger
  30.   */
  31.  
  32. +#ifdef MODULE
  33. +#include <linux/module.h>
  34. +#endif
  35. +
  36.  #include <asm/segment.h>
  37.  
  38.  #include <linux/ifs_fs.h>
  39. @@ -12,6 +16,7 @@
  40.  #include <linux/errno.h>
  41.  #include <linux/stat.h>
  42.  #include <linux/fcntl.h>
  43. +#include <linux/mm.h>
  44.  
  45.  
  46.  static int ifs_do_build_path(struct inode *dir);
  47. @@ -32,7 +37,7 @@
  48.      ifs_close_file(filp);
  49.  Dprintk("retval = %d\n",retval);
  50.      if (retval <= 0)
  51. -        return retval ? retval : -ENOENT;
  52. +        return retval ? de->d_reclen : -ENOENT;
  53.      return 0;
  54.  }
  55.  
  56. @@ -144,19 +149,20 @@
  57.      struct file *in,*out;
  58.      unsigned long page;
  59.      int retval,size;
  60. +    struct iattr    newattr;
  61.  
  62.      USE_INODE(dir);
  63.      retval = dir->i_op->create(dir,name,len,orig->i_mode & ~0777,&new_file);
  64.      if (retval)
  65.          return retval;
  66. -    new_file->i_uid = orig->i_uid;
  67. -    new_file->i_gid = orig->i_gid;
  68. -    new_file->i_atime = orig->i_atime;
  69. -    new_file->i_mtime = orig->i_mtime;
  70. -    new_file->i_ctime = orig->i_ctime;
  71. +    new_file->i_uid = newattr.ia_uid = orig->i_uid;
  72. +    new_file->i_gid = newattr.ia_gid = orig->i_gid;
  73. +    new_file->i_atime = newattr.ia_atime = orig->i_atime;
  74. +    new_file->i_mtime = newattr.ia_mtime = orig->i_mtime;
  75. +    new_file->i_ctime = newattr.ia_ctime = orig->i_ctime;
  76. +    newattr.ia_valid = ATTR_UID|ATTR_GID|ATTR_ATIME|ATTR_MTIME|ATTR_CTIME;
  77.      if (new_file->i_sb->s_op && new_file->i_sb->s_op->notify_change)
  78. -        new_file->i_sb->s_op->notify_change(NOTIFY_UIDGID | NOTIFY_TIME,
  79. -            new_file);
  80. +        new_file->i_sb->s_op->notify_change(new_file, &newattr);
  81.      retval = ifs_open_file(orig,&in,O_RDONLY);
  82.      if (retval) {
  83.          USE_INODE(dir);
  84. @@ -187,9 +193,10 @@
  85.          iput(new_file);
  86.          return size < 0 ? size : retval < 0 ? retval : -ENOSPC;
  87.      }
  88. -    new_file->i_mode = orig->i_mode;
  89. +    new_file->i_mode = newattr.ia_mode = orig->i_mode;
  90. +    newattr.ia_valid = ATTR_MODE;
  91.      if (new_file->i_sb->s_op && new_file->i_sb->s_op->notify_change)
  92. -        new_file->i_sb->s_op->notify_change(NOTIFY_MODE,new_file);
  93. +        new_file->i_sb->s_op->notify_change(new_file, &newattr);
  94.      if (result)
  95.          *result = new_file;
  96.      else iput(new_file);
  97. diff --unified --recursive --new-file ifs.5.1a/fs/ifs/dir.c ifs-module/fs/ifs/dir.c
  98. --- ifs.5.1a/fs/ifs/dir.c    Tue Apr 26 04:04:48 1994
  99. +++ ifs-module/fs/ifs/dir.c    Tue Jan 24 23:37:51 1995
  100. @@ -6,12 +6,16 @@
  101.   *  IFS directory handling functions
  102.   */
  103.  
  104. +#ifdef MODULE
  105. +#include <linux/module.h>
  106. +#endif
  107. +
  108.  #include <asm/segment.h>
  109.  
  110.  #include <linux/kernel.h>
  111.  #include <linux/fs.h>
  112.  #include <linux/mm.h>
  113. -#include <linux/ifs_fs.h>
  114. +#include "linux/ifs_fs.h"
  115.  #include <linux/errno.h>
  116.  #include <linux/stat.h>
  117.  #include <linux/fcntl.h>
  118. @@ -22,7 +26,7 @@
  119.  static int ifs_readdir(struct inode *inode,struct file *filp,
  120.      struct dirent *dirent,int count);
  121.  static int ifs_dir_ioctl(struct inode *inode,struct file *file,unsigned int op,
  122. -    unsigned int arg);
  123. +    unsigned long arg);
  124.  static int ifs_dir_open(struct inode *inode,struct file *filp);
  125.  static void ifs_dir_release(struct inode *inode,struct file *filp);
  126.  
  127. @@ -118,6 +122,7 @@
  128.              IFS_F(filp)->layer++;
  129.              continue;
  130.          }
  131. +        length = de.d_reclen;
  132.  Dprintk("length=%d\n",length);
  133.          if (length == 2 && de.d_name[0] == '.' && de.d_name[1] == '.') {
  134.              for (n = 0; n < IFS_F(filp)->layer; n++)
  135. @@ -171,7 +176,7 @@
  136.  
  137.  
  138.  static int ifs_dir_ioctl(struct inode *inode,struct file *file,unsigned int op,
  139. -    unsigned int arg)
  140. +    unsigned long arg)
  141.  {
  142.      char *page;
  143.      int retval;
  144. diff --unified --recursive --new-file ifs.5.1a/fs/ifs/file.c ifs-module/fs/ifs/file.c
  145. --- ifs.5.1a/fs/ifs/file.c    Tue Apr 26 04:04:49 1994
  146. +++ ifs-module/fs/ifs/file.c    Tue Jan 24 23:37:57 1995
  147. @@ -6,11 +6,15 @@
  148.   *  IFS regular file handling primitives
  149.   */
  150.  
  151. +#ifdef MODULE
  152. +#include <linux/module.h>
  153. +#endif
  154. +
  155.  #include <asm/segment.h>
  156.  #include <linux/errno.h>
  157.  #include <linux/kernel.h>
  158.  #include <linux/fs.h>
  159. -#include <linux/ifs_fs.h>
  160. +#include "linux/ifs_fs.h"
  161.  
  162.  
  163.  static int ifs_lseek(struct inode *inode,struct file *filp,off_t offset,
  164. @@ -40,9 +44,8 @@
  165.  IFS_F_WRAPPER(read,C_ char *buffer C_ int size,C_ buffer C_ size,-EINVAL)
  166.  IFS_F_WRAPPER(write,C_ char *buffer C_ int size,C_ buffer C_ size,-EINVAL)
  167.  IFS_F_WRAPPER(select,C_ int flag C_ select_table *table,C_ flag C_ table,1)
  168. -IFS_F_WRAPPER(ioctl,C_ unsigned int op C_ unsigned int arg,C_ op C_ arg,-EINVAL)
  169. -IFS_F_WRAPPER(mmap,C_ unsigned long addr C_ size_t length C_ int mask C_
  170. -    unsigned long offset,C_ addr C_ length C_ mask C_ offset,-ENODEV)
  171. +IFS_F_WRAPPER(ioctl,C_ unsigned int op C_ unsigned long arg,C_ op C_ arg,-EINVAL)
  172. +IFS_F_WRAPPER(mmap,C_ struct vm_area_struct * vma,C_ vma,-ENODEV)
  173.  IFS_F_WRAPPER(fsync,,,0) /* ? */
  174.  
  175.  
  176. diff --unified --recursive --new-file ifs.5.1a/fs/ifs/inode.c ifs-module/fs/ifs/inode.c
  177. --- ifs.5.1a/fs/ifs/inode.c    Tue Apr 26 04:04:49 1994
  178. +++ ifs-module/fs/ifs/inode.c    Tue Jan 24 23:43:05 1995
  179. @@ -4,16 +4,23 @@
  180.   *  Written 1992,1993 by Werner Almesberger
  181.   */
  182.  
  183. +#ifdef MODULE
  184. +#include <linux/module.h>
  185. +#endif
  186. +
  187.  #include <asm/segment.h>
  188.  
  189.  #include <linux/fs.h>
  190. -#include <linux/ifs_fs.h>
  191. +#include "linux/ifs_fs.h"
  192.  #include <linux/sched.h>
  193.  #include <linux/errno.h>
  194.  #include <linux/string.h>
  195.  #include <linux/locks.h>
  196.  #include <linux/stat.h>
  197.  
  198. +#ifdef MODULE
  199. +    #include <linux/version.h>
  200. +#endif
  201.  
  202.  void ifs_put_inode(struct inode *inode)
  203.  {
  204. @@ -41,6 +48,9 @@
  205.      lock_super(sb);
  206.      sb->s_dev = 0;
  207.      unlock_super(sb);
  208. +    #ifdef MODULE
  209. +        MOD_DEC_USE_COUNT;
  210. +    #endif
  211.      return;
  212.  }
  213.  
  214. @@ -116,6 +126,9 @@
  215.  Dprintk("initializing root\n");
  216.      ifs_init_inode(s->s_mounted,layers);
  217.      IFS_I(s->s_mounted)->parent = NULL;
  218. +    #ifdef MODULE
  219. +        MOD_INC_USE_COUNT;
  220. +    #endif
  221.      return s;
  222.  }
  223.  
  224. @@ -162,27 +175,28 @@
  225.  }
  226.  
  227.  
  228. -int ifs_notify_change(int flags,struct inode *inode)
  229. +int ifs_notify_change(struct inode *inode, struct iattr *attr)
  230.  {
  231.      int retval;
  232.  
  233. -Dprintk("ifs_notify_change (0x%X,0x%X)\n",flags,(int) inode);
  234. -    if (flags && IFS_IS_RO(inode)) {
  235. +Dprintk("ifs_notify_change (0x%X,0x%X)\n",attr->ia_valid,(int) inode);
  236. +    if (attr->ia_valid && IFS_IS_RO(inode)) {
  237.          inode->i_uid = IFS_I(inode)->val_uid;
  238.          inode->i_gid = IFS_I(inode)->val_gid;
  239.          inode->i_mode = IFS_I(inode)->val_mode;
  240.          inode->i_size = IFS_I(inode)->val_size;
  241.          return -EROFS;
  242.      }
  243. -    if (inode->i_uid == IFS_I(inode)->val_uid && inode->i_gid ==
  244. -        IFS_I(inode)->val_gid)
  245. -        flags &= ~NOTIFY_UIDGID;
  246. -    if (inode->i_mode == IFS_I(inode)->val_mode)
  247. -        flags &= ~NOTIFY_MODE;
  248. -    if (inode->i_size == IFS_I(inode)->val_size || !(S_ISREG(inode->i_mode)
  249. -        || S_ISDIR(inode->i_mode)))
  250. -        flags &= ~NOTIFY_SIZE;
  251. -    if (!flags)
  252. +    if (attr->ia_valid & ATTR_UID && attr->ia_uid == IFS_I(inode)->val_uid)
  253. +        attr->ia_valid &= ~ATTR_UID;
  254. +    if (attr->ia_valid & ATTR_GID && attr->ia_gid == IFS_I(inode)->val_gid)
  255. +        attr->ia_valid &= ~ATTR_GID;
  256. +    if (attr->ia_valid & ATTR_MODE && attr->ia_mode == IFS_I(inode)->val_mode)
  257. +        attr->ia_valid &= ~ATTR_MODE;
  258. +    if (attr->ia_valid & ATTR_SIZE && (attr->ia_size == IFS_I(inode)->val_size || !(S_ISREG(inode->i_mode)
  259. +        || S_ISDIR(inode->i_mode))))
  260. +        attr->ia_valid &= ~ATTR_SIZE;
  261. +    if (!attr->ia_valid)
  262.          return 0;
  263.      if (!IFS_NTH(inode,0)) {
  264.          retval = ifs_clone_file(inode);
  265. @@ -195,5 +209,26 @@
  266.      IFS_NTH(inode,0)->i_size = IFS_I(inode)->val_size = inode->i_size;
  267.      if (!IFS_CAN_SB(inode,0,notify_change))
  268.          return 0;
  269. -    return IFS_DO_SB(inode,0,notify_change,(flags,IFS_NTH(inode,0)));
  270. +    return IFS_DO_SB(inode,0,notify_change,(IFS_NTH(inode,0),attr));
  271. +}
  272. +
  273. +#ifdef MODULE
  274. +
  275. +char kernel_version[] = UTS_RELEASE;
  276. +
  277. +static struct file_system_type ifs_fs_type = {
  278. +    ifs_read_super, "ifs", 0, NULL
  279. +};
  280. +
  281. +int init_module(void)
  282. +{
  283. +    register_filesystem(&ifs_fs_type);
  284. +    return 0;
  285. +}
  286. +
  287. +void cleanup_module(void)
  288. +{
  289. +    unregister_filesystem(&ifs_fs_type);
  290.  }
  291. +
  292. +#endif
  293. diff --unified --recursive --new-file ifs.5.1a/fs/ifs/misc.c ifs-module/fs/ifs/misc.c
  294. --- ifs.5.1a/fs/ifs/misc.c    Tue Apr 26 04:04:49 1994
  295. +++ ifs-module/fs/ifs/misc.c    Tue Jan 24 23:43:57 1995
  296. @@ -4,9 +4,13 @@
  297.   *  Written 1992,1993 by Werner Almesberger
  298.   */
  299.  
  300. +#ifdef MODULE
  301. +#include <linux/module.h>
  302. +#endif
  303. +
  304.  #include <asm/segment.h>
  305.  
  306. -#include <linux/ifs_fs.h>
  307. +#include "linux/ifs_fs.h"
  308.  #include <linux/sched.h>
  309.  #include <linux/kernel.h>
  310.  #include <linux/errno.h>
  311. diff --unified --recursive --new-file ifs.5.1a/fs/ifs/namei.c ifs-module/fs/ifs/namei.c
  312. --- ifs.5.1a/fs/ifs/namei.c    Tue Apr 26 04:04:49 1994
  313. +++ ifs-module/fs/ifs/namei.c    Tue Jan 24 23:44:01 1995
  314. @@ -4,9 +4,13 @@
  315.   *  Written 1992,1993 by Werner Almesberger
  316.   */
  317.  
  318. +#ifdef MODULE
  319. +#include <linux/module.h>
  320. +#endif
  321. +
  322.  #include <asm/segment.h>
  323.  
  324. -#include <linux/ifs_fs.h>
  325. +#include "linux/ifs_fs.h"
  326.  #include <linux/kernel.h>
  327.  #include <linux/errno.h>
  328.  #include <linux/stat.h>
  329. diff --unified --recursive --new-file ifs.5.1a/fs/ifs/symlink.c ifs-module/fs/ifs/symlink.c
  330. --- ifs.5.1a/fs/ifs/symlink.c    Tue Apr 26 04:04:49 1994
  331. +++ ifs-module/fs/ifs/symlink.c    Wed Jan 25 04:16:56 1995
  332. @@ -6,13 +6,18 @@
  333.   *  IFS symlink handling code
  334.   */
  335.  
  336. +#ifdef MODULE
  337. +#include <linux/module.h>
  338. +#endif
  339. +
  340.  #include <asm/segment.h>
  341.  
  342.  #include <linux/sched.h>
  343.  #include <linux/errno.h>
  344.  #include <linux/fs.h>
  345. -#include <linux/ifs_fs.h>
  346. +#include "linux/ifs_fs.h"
  347.  #include <linux/stat.h>
  348. +#include <linux/mm.h>
  349.  
  350.  
  351.  static int ifs_readlink(struct inode *inode,char *buffer,int buflen);
  352. @@ -53,7 +58,7 @@
  353.  
  354.      *res_inode = NULL;
  355.      if (!dir) {
  356. -        dir = current->root;
  357. +        dir = current->fs->root;
  358.          dir->i_count++;
  359.      }
  360.      if (!inode) {
  361. diff --unified --recursive --new-file ifs.5.1a/ifs-patch ifs-module/ifs-patch
  362. --- ifs.5.1a/ifs-patch    Thu Jan  1 01:00:00 1970
  363. +++ ifs-module/ifs-patch    Sun Feb  5 22:47:10 1995
  364. @@ -0,0 +1,36 @@
  365. +--- /usr/src/linux/include/linux/fs.h-old    Sun Feb  5 22:39:26 1995
  366. ++++ /usr/src/linux/include/linux/fs.h    Sun Jan 15 15:31:24 1995
  367. +@@ -251,6 +251,8 @@
  368. +     } u;
  369. + };
  370. ++#include <linux/ifs_fs_f.h>
  371. ++
  372. + struct file {
  373. +     mode_t f_mode;
  374. +     loff_t f_pos;
  375. +@@ -262,6 +264,7 @@
  376. +     struct inode * f_inode;
  377. +     struct file_operations * f_op;
  378. +     unsigned long f_version;
  379. ++    struct ifs_file_info    ifs_f;
  380. +     void *private_data;    /* needed for tty driver, and maybe others */
  381. + };
  382. +--- /usr/src/linux/fs/Makefile-old    Sun Feb  5 22:43:26 1995
  383. ++++ /usr/src/linux/fs/Makefile    Tue Jan 24 23:26:28 1995
  384. +@@ -7,7 +7,13 @@
  385. + #
  386. + # Note 2! The CFLAGS definitions are now in the main makefile...
  387. +-SUBDIRS = minix ext ext2 msdos proc isofs nfs xiafs umsdos hpfs sysv
  388. ++SUBDIRS = minix ext ext2 msdos proc isofs nfs xiafs umsdos hpfs sysv ifs
  389. ++
  390. ++ifdef CONFIG_IFS_FS
  391. ++FS_SUBDIRS := $(FS_SUBDIRS) ifs
  392. ++else
  393. ++MODULE_FS_SUBDIRS := $(MODULE_FS_SUBDIRS) ifs
  394. ++endif
  395. + ifdef CONFIG_MINIX_FS
  396. + FS_SUBDIRS := $(FS_SUBDIRS) minix
  397. diff --unified --recursive --new-file ifs.5.1a/include/linux/ifs_fs.h ifs-module/include/linux/ifs_fs.h
  398. --- ifs.5.1a/include/linux/ifs_fs.h    Tue Apr 26 04:05:57 1994
  399. +++ ifs-module/include/linux/ifs_fs.h    Fri Dec 16 20:38:50 1994
  400. @@ -6,6 +6,8 @@
  401.   */
  402.  
  403.  #include <linux/fs.h>
  404. +#include <linux/ifs_fs_i.h>
  405. +#include <linux/ifs_fs_sb.h>
  406.  #include <linux/ifs_fs_param.h>
  407.  
  408.  #define Dprintk (void)
  409. @@ -64,11 +66,11 @@
  410.  #define IFS_DEL_NAME(n,l) \
  411.    (l == 3 && n[2] == '.' && n[0] == '.' && n[1] == '.')
  412.  
  413. -#define IFS_SB(s) (&((s)->u.ifs_sb))
  414. -#define IFS_I(i) (&((i)->u.ifs_i))
  415. -#define IFS_F(f) (&((f)->u.ifs_f))
  416. -#define IFS_NTH(i,n) ((i)->u.ifs_i.layer[n])
  417. -#define IFS_LAYERS(i) ((i)->i_sb->u.ifs_sb.layers)
  418. +#define IFS_SB(s) ((struct ifs_sb_info *)&((s)->u.generic_sbp))
  419. +#define IFS_I(i) ((struct ifs_inode_info *)&((i)->u.generic_ip))
  420. +#define IFS_F(f) (&((f)->ifs_f))
  421. +#define IFS_NTH(i,n) (IFS_I(i)->layer[n])
  422. +#define IFS_LAYERS(i) (IFS_SB((i)->i_sb)->layers)
  423.  
  424.  #define IFS_IS_RO(i) (IS_RDONLY(IFS_NTH(i->i_sb->s_mounted,0)))
  425.  
  426. @@ -151,7 +153,7 @@
  427.  extern void ifs_statfs(struct super_block *sb,struct statfs *buf);
  428.  extern void ifs_read_inode(struct inode *inode);
  429.  extern void ifs_write_inode(struct inode *inode);
  430. -extern int ifs_notify_change(int flags,struct inode *inode);
  431. +extern int ifs_notify_change(struct inode *, struct iattr *);
  432.  
  433.  /* dir.c */
  434.  
  435.